<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <!-- meta -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<!--    <meta name="description" content="Hellohao图床是一个基于JAVA-SpringBoot开发的,免费纯粹的图片存放驿站">&lt;!&ndash;站点描述&ndash;&gt;-->
<!--    <meta name="author" content="tc.hellohao.cn">-->
<!--    <meta name="keywords" content="图床,图片上传,hellohao图床,开源图床,hellohao">&lt;!&ndash;关键词&ndash;&gt;-->
    <!-- title -->
	<title th:text="${config.getWebname()}"></title>

	<link rel="shortcut icon" href="https://hellohao.nos-eastchina1.126.net/BlogImg/favicon.ico" type="image/x-icon"/>
	<link rel="icon" type="image/ico" href="https://hellohao.nos-eastchina1.126.net/BlogImg/favicon.ico">
    <!-- CSS IMPORT -->
    <link rel="stylesheet" th:href="@{css/style.css}" type="text/css" />
	<link th:href="@{/webuploade/css/webuploader.css}" media="all" rel="stylesheet" type="text/css"/>
	<link th:href="@{/webuploade/css/style.css}" media="all" rel="stylesheet" type="text/css"/>
	<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
	<link th:href="@{/static/css/bootstrap.min.css}" rel="stylesheet">
	<link th:href="@{/static/css/toastr.min.css}" media="all" rel="stylesheet" type="text/css"/>
	<link th:href="@{/static/css/login-register.css}" media="all" rel="stylesheet" type="text/css"/>
	<link th:href="@{/static/css/sweetalert.min.css}" media="all" rel="stylesheet" type="text/css"/>
    <link th:href="@{/webuploade/css/component.css}" media="all" rel="stylesheet" type="text/css"/>
<!--	<link th:href="@{/static/css/popover.css}" media="all" rel="stylesheet" type="text/css"/>-->
	<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}">

	<script th:src="@{/static/js/toastr.min.js}" type="text/javascript"></script>
	<script th:src="@{/static/js/login-register.js}"></script>
	<script th:src="@{/static/js/clipboard.min.js}"></script>
	<script th:src="@{/static/js/bootbox.min.js}"></script>
<!--	<script th:src="@{/static/js/sweetalert.min.js}"></script>-->
<!--	<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>-->
	<script th:src="@{/static/js/sweetalert2.min.js}"></script>
<!--	<script th:src="@{/static/js/popover.min.js}"></script>-->
	<script th:src="@{/layui/layui/layui.js}"></script>
		<style type="text/css">
		a{transition: all 0.6s;}
		a:hover{
			text-decoration: none;
			transform: scale(1.4);}
		#goupdate{
			width:120px;
			height:50px;
			margin-right: 6%;
			font-size:1.5em;
			line-height:50px;
			 text-align:center; 
			 float: right;
			 color:#FFF;
			 border:2px solid;
			 border-radius:5px;
			 -moz-border-radius:5px;
			 cursor:pointer;
		}
		#goupdate2{
			width:120px;
			height:50px;
			margin-right: 6%;
			font-size:1.5em;
			line-height:50px;
			text-align:center;
			float: right;
			color:#FFF;
			border:2px solid;
			border-radius:5px;
			-moz-border-radius:5px;
			cursor:pointer;
		}
		#goupdate:hover{}

		</style>
</head>
<body class="simple">
    <!-- preloader -->
    <div class="preloader-container">
        <div class="content-container">
            <!-- preloader -->
            <span class="spinner-section-far"></span>
            <!-- end preloader -->
            <h6 class="preloader-text">
                LOADING</h6>
        </div>
    </div>
    <!-- end preloader -->
    <!-- logo -->
    <img class="img-logo menu-link" data-section="home" data-nav-title="home" alt="logo" th:src="@{img/logo_white.png}" />
    <!-- end logo -->
    <!-- menu -->
    <div class="open">
        <div class="cls">
        </div>
        <div>
            <ul class="sub-menu-t" id="usersrc">
                <li class="active"><a class="menu-link" data-section="home" data-nav-title="home"
                    data-section-pos="0" data-section-posy="0">首页 <i class="fa fa-fw fa-home"></i>
                </a></li>                
                <li><a href="javascript:;" class="md-trigger" data-modal="modal-3">登录&nbsp;<span class="glyphicon glyphicon-user" aria-hidden="true"></span></a></li>
				<li><a href="javascript:;" class="md-trigger" data-modal="modal-4">注册&nbsp;<span class="glyphicon glyphicon-education" aria-hidden="true"></span></a></li>
<!--				<li><a class="menu-link" href="https://github.com/Hello-hao/Tbed" target="_blank"-->
<!--				>GitHub<i class="fa fa-github"></i></a></li>-->
<!--				<li><a href="javascript:;" class="md-trigger" data-modal="modal-2">赞助商&nbsp;<i class="fa fa-share-alt"></i></a></li>-->

				<!--				<li><a class="menu-link" onclick="tanchuang('亲爱的开发者','全新的响应式图床站，如果你也喜欢，希望给我一个Star。\n Hellohao开发者交流群：864800972','success');"-->
<!--				>关于<i class="fa fa-share-alt"></i></a></li>-->
            </ul>
        </div>
        <div class="cls">
        </div>
    </div>
    <!-- end menu  -->
    <!-- page container -->
    <div class="page-container">
        <!-- section container -->
        <div class="section-container">
            <!-- home section -->
            <section class="home-section">
        	    	<!-- section background -->
        	    	<div class="bg-container"></div>
                	<!-- end section background -->
                	<!-- content -->
                	<div class="content col-lg-8 col-lg-offset-2 col-md-8 col-md-offset-2 col-sm-12 col-xs-rlt no-pad centering-y">            	    	
            	    	<div class="col-md-12 col-sm-12">
                	    	<!-- headline -->
							<h1 style="font-size: 4.5em;" th:text="${config.getWebname()}"></h1>
							<a id="goupdate" class="menu-link" data-section="contact" data-nav-title="contact" data-section-pos="-100"
								data-section-posy="0"><span class="glyphicon glyphicon-open" aria-hidden="true"></span>立即上传</a>
<!--							<a id="goupdate2"  onclick="xiazai()">-->
<!--								<span class="glyphicon glyphicon-th-large" aria-hidden="true"></span>客户端</a>-->

                            <div class="sub-title" id="wordsrotator">
                		    	<h4>纯粹免费的图片驿站</h4>	
							</div> 
                   	    	
                	    	<!-- end headline -->                               
                	    	<!-- short description -->
                	    	<p class="desc" th:text="${config.getExplain()}">
									Hellohao Figure bed：support several mainstream object storage, CDN acceleration is more stable.
Technology constantly updated, we will always move forward on the road ahead.
                	    	</p>
                	    	<!-- end short description -->
                            <!-- countdown container -->
                        	<div id="countdown" class="countdown-container">
                    	    	<!-- days left -->
                            	<div class="dash days_dash" style="max-width: 172px;">
                			    	<div class="counter">
            	    	    	        <div class="dash_title">days</div>
            	    	    	        <div id="ri" style="margin-top: 26%;font-size: 2.5em;color: #FFFFFF;font-weight: bold;">0</div>
							        </div>
                		    	</div>
                                <!-- end days left -->
                                <!-- hours left -->
                                <div class="dash hours_dash" style="max-width: 172px;">
            	    		        <div class="counter">
            	    	    	        <div class="dash_title">hours</div>
										<div id="shi" style="margin-top: 26%;font-size: 2.5em;color: #FFFFFF;font-weight: bold;">0</div>
							        </div>
            	    	        </div>
                                <!-- end hours left -->
                                <!-- minutes left -->
                                <div class="dash minutes_dash" style="max-width: 172px;">
            	    		        <div class="counter">
            	        		        <div class="dash_title">mins</div>
										<div id="fen" style="margin-top: 26%;font-size: 2.5em;color: #FFFFFF;font-weight: bold;">0</div>
							        </div>
                		        </div>
                                <!-- minutes left -->
                		        <div class="dash seconds_dash" style="max-width: 172px;">
                			        <div class="counter">
                		    	        <div class="dash_title">secs</div>
										<div id="miao" style="margin-top: 26%;font-size: 2.5em;color: #FFFFFF;font-weight: bold;">0</div>
							        </div>
                		        </div>
                                <!-- end minutes left -->
            		        </div>
                        	<!-- end countdown container -->
                    	</div>                    	
                	</div>
                	<!-- end content -->
            	</section>
            <!-- end home section -->
            <div class="tlinks">Collect from <a href="/" >网站建设</a></div>
            <!-- contact section -->
            <section class="contact-section">
				<ul style="  position: absolute;right: 63px;top: 24px;z-index: 9999;">
					<li class="active">
						<a class="menu-link" data-section="home" data-nav-title="home"data-section-pos="0" data-section-posy="0">
							<i class="fa fa-fw fa-home" style="font-size: 40px;color: #FFF;"></i>
						</a>
					</li>
				</ul>
        	    	<!-- section background -->
        	    	<div class="bg-container-static"></div>
                	<!-- end section background -->
                	<!-- content -->
                	<div class="content col-md-10 col-md-offset-1 col-sm-12 col-xs-12 no-pad centering-y col-sm-rlt" >
						<div class="col-md-12 col-sm-12">

							<form enctype="multipart/form-data">
								<!--        <div class="form-group">-->
								<!--图片上传模板-->
								<div id="wrapper">
									<div id="container">
										<!--头部，相册选择和格式选择-->
										<div id="uploader">
											<div class="queueList">
												<div id="dndArea" class="placeholder">
													<br />
													<span class="text">您也可以尝试文件拖拽，使用QQ截屏工具，然后激活窗口后粘贴。<span id="whts" data-toggle="popover" title="Example popover" class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></span>
													<br />
													<span class="text" ><a style="color: #4ebd87;font-size: 0.9em;cursor:pointer;font-weight: bold;" onclick="imgsc()">使用图片URL地址上传</a></span>

													<div id="filePicker">

													</div>
												</div>
											</div>
											<div class="statusBar" style="display:none;">
												<div class="progress">
													<span class="text">0%</span>
													<span class="percentage"></span>
												</div><div class="info"></div>
												<div class="btns">
													<div id="filePicker2"></div><div class="uploadBtn">开始上传</div>
												</div>
											</div>
										</div>
									</div>
								</div>
								<!--        </div>-->
							</form>
							<form class="contact-form" action="contact.php" method="post" enctype="multipart/form-data">

								<!-- full width -->
								<div class="col-xs-12 text-center no-pad">
									<div class="input-container no-mrg" id="urlstext">
										<textarea id="urls" name="message"  style="border: 1px solid #838383;border-radius: 5px;"></textarea>
										<div class="input-border-bottom"></div>
									</div>

									<!-- notification container -->
									<div class="col-xs-12 notif-container no-pad">
										<div class="form-notif"></div>
									</div>
									<!-- end button container -->
								</div>
								<!-- end full width -->
							</form>
							<!-- button container -->
							<div class="col-xs-12 no-pad text-left mrg-top-xs">
								<div style="margin: 0 auto;text-align:center">
									<button type="button" onclick="urltype(1);" class="button button-green button-small">URL</button>
									<button type="button" onclick="urltype(2);"  class="button button-green button-small">Markdown</button>
									<button type="button" onclick="urltype(3);"  class="button button-green button-small">HTML</button>
								</div>
							</div>
							</div>
						<!-- contact form container -->
                	</div>
                	<!-- end content -->
            	</section>

        </div>
        <!-- end section container -->
    </div>

	<!-- 登录注册框 -->
	<div class="modal fade login" id="loginModal">
		<div class="modal-dialog login animated" id = "tanchuang" >
			<div id="tanchuang2" class="modal-content" >
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h4 class="modal-title">系统登录</h4>
				</div>
				<div class="modal-body">
					<div class="box">
						<div class="content">
							<div class="social">
								<p id="biaoti" style="color: #4a4a4f;font-size: 1.5em;">
									账号登录
								</p>

							</div>
							<div class="division">
								<div class="line l"></div>
								<span>&nbsp;</span>
								<div class="line r"></div>
							</div>
							<div class="error"></div>
<!--							<div class="form loginBox">-->
<!--								<form id="login" method="post" accept-charset="UTF-8">-->
<!--									<input id="loginemail" class="form-control" type="text" placeholder="邮箱" name="email">-->
<!--									<input id="loginpassword" class="form-control" type="password" placeholder="密码"-->
<!--										   name="password">-->
<!--									<input id="login-btn" data-toggle="dropdown"-->
<!--										   class="btn btn-default btn-login dropdown-toggle" type="button" value="登录"-->
<!--										   onclick="loginAjax()">-->
<!--								</form>-->
<!--							</div>-->
						</div>
					</div>
					<div class="box">
						<div class="content registerBox" style="display:none;">
							<div class="form">

							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<div class="forgot login-footer">
                            <span>你希望
                                 <a href="javascript: showRegisterForm();">创建一个帐户</a>
                            ?</span>
					</div>
					<div class="forgot register-footer" style="display:none">
						<span>已经有一个帐户吗?</span>
						<a href="javascript: showLoginForm();">登录</a>
					</div>
				</div>
			</div>
		</div>
	</div>

    <div class="md-modal md-effect-3" id="modal-4">
        <div class="md-content"  >
            <h3>账号注册</h3>
            <div>
                <p style="color: #ea1c27;" id="zcts"></p>
				<div class="form loginBox">
					<form method="post" data-remote="true" accept-charset="UTF-8">
						<div style="font-size: 13px;">
                                        <span> ●用户名注册后不能修改<br/>
                                         ●邮箱激活链接如果没有请在【垃圾箱】查找</span>
						</div>
						<hr/>
						<input id="registerusername" style="border-left:none;border-right:none;border-top:none;border-bottom:none;"  type="text"
							   placeholder="用户名(数字/字母不得超过10位)"
							   name="username">
						<input id="registeremail" style=" border-left:none;border-right:none;border-top:none;border-bottom:none;"  type="text" placeholder="邮箱"
							   name="email">
						<input id="registerpassword" style="color:#000;background-color:#fff;padding: 18px 25px 22px 25px;; border-left:none;border-right:none;border-top:none;border-bottom: none;"  type="text" placeholder="密码"
							   name="password">
						<input id="registerpassword_confirmation" style="color:#000;background-color:#fff;padding: 18px 25px 22px 25px; border-left:none;border-right:none;border-top:none;border-bottom: none;"  type="text"
							   placeholder="重复密码" name="password_confirmation">
					</form>
				</div>
				<div style="width: 100%;height: 30px;">
					<br />
					<button class=" btn-sm btn-primary" style="float: right;" onclick="ismail();">注册</button>
				</div>
            </div>
        </div>
    </div>

<!--	注册-->
	<div class="md-modal md-effect-3" id="modal-3">
		<div class="md-content">
			<h3>账号登录</h3>
			<div>
				<p></p>
				<div class="form loginBox">
					<form id="login" onkeydown="keyLogin();">
						<div class="form-group">
							<label for="loginemail">Email address</label>
							<input id="loginemail" type="email" style=" border-left:none;border-right:none;border-top:none;border-bottom:1px solid #0F2543;"  placeholder="Email">
						</div>
						<div class="form-group">
							<label for="loginpassword">Password</label>
							<input id="loginpassword" type="password" style="color:#000;background-color:#fff;padding: 18px 25px 22px 25px;width: 100%; border-left:none;border-right:none;border-top:none;border-bottom:1px solid #0F2543;"   placeholder="Password">
							<hr />
						</div>

					</form>
				</div>
				<div style="width: 100%;height: 30px;">
					<button class=" btn-sm btn-primary" id="dl" style="float: right;" onclick="loginAjax()">登录</button>
				</div>
			</div>
		</div>
	</div>


	<!--	赞助商-->
	<div class="md-modal md-effect-3" id="modal-2">
		<div class="md-content">
			<h3>服务赞助商</h3>
			<div>
				<p></p>
				<div class="form loginBox">
					<a href="https://www.maoyuncloud.com/" target="_blank">
						<img style="max-width: 33.3%;" src="http://cdn.wwery.com/tourist/4c7810718014927.png" />
					</a>
				</div>
			</div>
		</div>
	</div>
	<div class="md-overlay"></div>

<!--	http://cdn.wwery.com/tourist/4c7810718014927.png
-->

	<script th:src="@{/webuploade/js/webuploader.js}"></script>
	<script th:src="@{/webuploade/js/upload.js}" ></script>
	<script type="text/javascript" th:src="@{js/jquery.js}"></script>
	<script th:src="@{js/html5shiv.js}"></script>
	<script th:src="@{js/respond.min.js}"></script>
    <script th:src="@{/webuploade/js/classie.js}"></script>
    <script th:src="@{/webuploade/js/modalEffects.js}"></script>
    <!-- bootstrap -->
    <script type="text/javascript" th:src="@{js/bootstrap.min.js}"></script>
    <!-- other plugins -->
    <script type="text/javascript" th:src="@{js/plugins.min.js}"></script>
    <!-- google map -->
    <!-- main js -->
    <script type="text/javascript" th:src="@{js/main_constellation.js}"></script>

	<script th:inline="javascript">
		var arr_url = "";
		var arr_markdown = "";
		var arr_html = "";
		var urltypes = 1;//1 url 2 md 3 a标签

		var filesize = [[${filesize}]];
		var imgcount = [[${imgcount}]];
		var suffix= [[${suffix}]];
		// var bg1 = [[${config.getBackground1()}]];
		// var bg2 = [[${config.getBackground2()}]];
		$(document).ready(function () {
			$(".jb").fadeToggle();
			//$("#page-header").fadeToggle("slow");
			$(".jb").fadeToggle(4000);
		});

		if (window != top){top.location.href = location.href;}

		//当窗口被改变时
		$(window).resize(function(){

		});
		$(function () {
			var gg=[[${config.getNotice()}]];
			var arr=new Array();
			var arr2=new Array();
//可以用字符或字符串分割
			arr=gg.split('|');
			for(var i=0;i<arr.length;i++)
			{arr2.push('<h2>'+arr[i]+'</h2>');}
			$.wordrotator_words =arr2;

			setInterval(clock,1000);//首页动态时间

			$(".bg-container-static").css('background', 'url('+[[${config.getBackground2()}]]+') no-repeat');
			$(".bg-container-static").css('background-position', '50% 50%');
			//设置页面资料
			var webname = [[${config.getWebname()}]];
			var explain = [[${config.getExplain()}]];
			var footeds = [[${config.getFooted()}]];
			var links = [[${config.getLinks()}]];
			var logos = [[${config.getLogos()}]];
			$("#webname").text(webname);
			$("#explain").text(explain);
			$("#footeds").text(footeds);
			$("#links").html(links);
			$("#logos").attr('src', logos);

			$("#whts").attr("title",'图片大小不得超过'+[[${uploadConfig.getFilesizetourists()}]]+' MB，登录本站可上传'+[[${uploadConfig.getFilesizeuser()}]]+' M图片以及查看历史图片记录等更多操作。');
			$.ajax({
				type: "POST",
				url: "/islogin",
				dataType: "json",
				success: function (data) {
					if(data.lgoinret==1){
						var h = '<li class="active"><a class="menu-link" data-section="home" data-nav-title="home"\n' +
								'                    data-section-pos="0" data-section-posy="0">Home <i class="fa fa-fw fa-home"></i>\n' +
								'                </a></li>';
						var h1 = '<li><a class="menu-link" target="_blank" href="/admin/goadmin" id="usernames">控制面板&nbsp;<i class="fa fa-fw fa-list"></i></a></li>';
						var h2 = '<li><a class="menu-link" href="javascript:exit();" title="666" onclick="">退出&nbsp;<span class="glyphicon glyphicon-log-out"></span></a></li>';
						$("#usersrc").html(h + h1 + h2);
					}
				}
			});

			toastr.options.positionClass = 'toast-bottom-right';
			toastr.options = {
				closeButton: true,//是否显示关闭按钮
				debug: false,
				progressBar: true,
				positionClass: "toast-bottom-right",
				onclick: null,
				showDuration: "300",
				hideDuration: "1000",
				timeOut: "2000",
				extendedTimeOut: "1000",
				showEasing: "swing",
				hideEasing: "linear",
				showMethod: "fadeIn",
				hideMethod: "fadeOut"
			};
			//toastr.info("欢迎使用Hellohao图床！");
		});

		function zhuce(mail, registerusername, registerpassword) {
			//验证成功
			$.ajax({
				type: "POST",
				url: "/user/register",
				data: {email: mail, username: registerusername, password: registerpassword},
				dataType: "json",
				success: function (data) {
					if (data.ret > 0) {
						if (data.zctype == 1) {
							layui.use('layer', function(){
								var layer = layui.layer;
								layer.alert('注册成功，请前往邮箱激活你的账号，注意！激活邮件如果迟迟未收到，有可能在您的【垃圾箱】中。', {
									skin: 'layui-layer-molv' //样式类名 自定义样式
									,closeBtn: 0  // 是否显示关闭按钮
									,anim: 1 //动画类型
									,btn: ['确定'] //按钮
									,icon: 1  // icon
									,yes:function(){
										window.location.reload();
									}
								});
							});
						} else {
							layui.use('layer', function(){
								var layer = layui.layer;

								layer.alert('注册成功，快去登录体验吧。', {
									skin: 'layui-layer-molv' //样式类名 自定义样式
									,closeBtn: 0  // 是否显示关闭按钮
									,anim: 1 //动画类型
									,btn: ['确定'] //按钮
									,icon: 1  // icon
									,yes:function(){
										window.location.reload();
									}
								});
							});
						}

					} else {
						if (data.ret == -2) {
							layui.use('layer', function(){
								var layer = layui.layer;

								layer.alert('注册失败，用户名或邮箱重复且用户名只能为字母数字，请重试。', {
									skin: 'layui-layer-molv' //样式类名 自定义样式
									,closeBtn: 0  // 是否显示关闭按钮
									,anim: 1 //动画类型
									,btn: ['确定'] //按钮
									,icon: 2  // icon
								});
							});
						} else {
							layui.use('layer', function(){
								var layer = layui.layer;
								layer.alert('注册失败，请重试。', {
									skin: 'layui-layer-molv' //样式类名 自定义样式
									,closeBtn: 0  // 是否显示关闭按钮
									,anim: 1 //动画类型
									,btn: ['确定'] //按钮
									,icon: 2  // icon
								});
							});
						}
						setTimeout(function () {
						}, 2000);
					}
				}
			});
		}

		//登录
		function loginAjax() {
			var loginemail = $("#loginemail").val();
			var loginpassword = $("#loginpassword").val();
			//验证成功
			$.ajax({
				type: "POST",
				url: "/user/login.do",
				data: {email: loginemail, password: loginpassword},
				dataType: "json",
				success: function (data) {
					$('#loginModal').modal('hide');
					if (data == 1) {
						toastr.success("登录成功。");
						setTimeout(function () {
							window.location.reload();
						}, 1000);
					} else {
						dd();
						if (data == -1) {
							toastr.error('账号未进行邮箱验证，请先验证邮箱。');
						} else {
							toastr.error('登录失败，请重试。');
						}
						setTimeout(function () {
							//window.location.reload();
						}, 2000);
					}
				}
			});
		}

		function exit() {
			$.ajax({
				type: "POST",
				url: "/user/exit.do",
				dataType: "json",
				success: function (data) {
					toastr.success("账号已退出。");
					window.location.reload();
				}
			});
		}

		function imgsc() {
			swal("输入图片URL地址：", {
				content: "input",
				//buttons: true
			})
			.then((value) => {
				var result =value;
				if(result!=null && result!="" ){
					urlimg(result);
				}
			});
		}

		function copy(val) {
			var data = null;
			if (val == 1) {
				data = $('#urls').text();
			} else if (val == 2) {
				data = $('#markdowns').text();
			} else if (val == 3) {
				data = $('#htmls').text();
			} else {
				return;
			}
			var copy = new ClipboardJS('.btn', {
				text: function (trigger) {
					return data;
				}
			});
			copy.on('success', function (e) {
				toastr.success("复制成功");
				copy.off("success");
			});
			copy.on('error', function (e) {
				toastr.error("复制失败");
				copy.off("error");
			});
		}
		function loadScriptString(code) {
			var script = document.createElement("script");
			script.type = "text/javascript";
			try {
				// firefox、safari、chrome和Opera
				script.appendChild(document.createTextNode(code));
			} catch (ex) {
				// IE早期的浏览器 ,需要使用script的text属性来指定javascript代码。
				script.text = code;
			}
			document.getElementsByTagName("head")[0].appendChild(script);
		}
		var baidu = [[${config.getBaidu()}]];
		loadScriptString(baidu);

		function urlimg(result) {
			if(result) {
				var rx=/^https?:\/\//i;
				if(rx.test(result)==true){
					$('#loadingModal').modal({backdrop: 'static', keyboard: false});
					$.ajax({
						type: "POST",
						url: "/upurlimg",
						dataType: "json",
						data: {imgurl: result},
						success: function (data) {
							for(var i=0;i<data.length;i++){

								if(data[i]==-1){
									$('#loadingModal').modal('hide');
									//tanchuang('上传失败','未配置存储源，请先后台配置存储源','error');
									swal('上传失败', '未配置存储源，请先后台配置存储源');

								}
								else if(data[i]==-2){
									$('#loadingModal').modal('hide');
									swal('上传失败', '图片不存在或太大');
								}
								else if(data[i]==-3){
									$('#loadingModal').modal('hide');
									swal('上传失败', '文件类型不符合要求');
								}
								else if(data[i]==-4){
									$('#loadingModal').modal('hide');
									swal('上传失败', '该文件不支持上传');
								}
								else{
									$('#loadingModal').modal('hide');
									swal('上传成功', '该图片链接已成功上传');
									$("#address").css('display', 'block');
									arr_url += data[i] + '\r\n';
									arr_markdown += '![ ](' + data[i] + ')\r\n';
									arr_html += '<img src="' + data[i] + '" alt="Image" title="Image" /> \r\n';
								}
								if(urltypes==1){
									$("#urls").text(arr_url);
								}else if(urltypes==2){
									$("#urls").text(arr_markdown);
								}else{
									$("#urls").text(arr_html);
								}
							}
						}
					});
				}else{tanchuang('网址格式错误','网址必须以http(s)://开头。','error');}
			}
		}

		function tanchuang(str1,str2,types) {
			swal({
				title: str1,
				text: str2,
				type: types,
				showCancelButton: false,//true显示两个按钮
				confirmButtonColor: "#A5DC86",
				confirmButtonText: "知道了",
				closeOnConfirm: true,
				closeOnCancel: false
			});
		}

		function urltype(urltypes){
			if(urltypes==1){
				$("#urls").text(arr_url);
			}else if(urltypes==2){
				$("#urls").text(arr_markdown);
			}else{
				$("#urls").text(arr_html);
			}
		}
//获取当前时间
		function clock(){
			now = new Date();
			year = now.getFullYear();
			month = now.getMonth() + 1;
			day = now.getDate();

			today = ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'];
			week = today[now.getDay()];

			hour = now.getHours();
			min = now.getMinutes();
			sec = now.getSeconds();
			if (hour < 10) {
				hour = "0" + hour;
			}
			if (min < 10) {
				min = "0" + min;
			}
			if (sec < 10) {
				sec = "0" + sec;
			}
			if (day < 10) {
				day = "0" + day;
			}
			//$("#nian").html(year);
			//$("#yue").html(month);
			$("#ri").html(day);
			$("#shi").html(hour);
			$("#fen").html(min);
			$("#miao").html(sec);
		}
		function xiazai(){
			swal({
				title: "即将下载客户端",
				text: "客户端目前支持支Windows系统，Mac后期可能会推出。",
				icon: "success",
				buttons: true,
				buttons: ["取消", "下载"],
				dangerMode: false,
			})
					.then((value) => {
				if (value) {
					window.open("https://hellohao.nos-eastchina1.126.net/TbedClient/Hellohao.7z");
				} else {

				}
			});

		}
//回车登录
		function keyLogin(){
			if (event.keyCode==13)  //回车键的键值为13
				document.getElementById("dl").click(); //调用登录按钮的登录事件
			//document.getElementById()
		}

		//页面模板效果
		(function ($) {
			"use strict";
			$.bg_type = 3;
			$.launch_date = [7, 9, 2016]; 										//-- launch date [d,m,yyyy], for example 7 September 2016 : [7,9,2016]
			$.bg_urls = [
				[[${config.getBackground1()}]]
			];
			$.youtube_url = ""; 												//-- just the last words after https://www.youtube.com/watch?v=
			$.self_host_video_path = ""; 									//-- self hosted video path
			$.self_host_video_filename = ""; 								//-- self hosted video filename "WITHOUT .MP4 EXTENSION"
			$.latitude_longitude = [ [21.1991367, 72.84016666] ];
			$.map_marker_url = "img/marker.png"; 							//-- Map marker image url
			$.map_marker_info = '<h6 class="text-darkgrey">Main Office</h6><p class="map-marker-info">Open at 09:00 - 15:00<br>Monday till Saturday</p>';
			$.enable_wordrotator = true; 									//-- enabling wordrotator on headline text
			$.wordrotator_words = ['<h2>也许...</h2>', '<h2>这将是你用过最好用的图床站</h2>']; //-- Array of words, for headline text
			$.is_changing_section = false;

		})(jQuery);

	</script>

</body>
</html>
